<div ng-show="vm.currentUser.uploadban == 'yes'" class="alert alert-warning" role="alert" translate="TORRENTS.UPLOAD_BANNED"></div>

<div class="text-center" ng-show="vm.currentUser.uploadban == 'no'">
	<h2 ng-if="vm.settings.reqid == 0" translate="TORRENTS.UPLOAD"></h2>
	<h2 ng-if="vm.settings.reqid > 0">{{ 'TORRENTS.UPLOAD_REQUEST' | translate }}: {{ vm.settings.request }}</h2>

	<div class="col-md-9 col-centered">
	<form role="form" ng-submit="vm.uploadFile()" enctype="multipart/form-data">
		<table class="table table-striped" cellpadding="15">
			<tr>
				<td style="width: 150px;" class="text-right tdBold alignMiddle" translate="TORRENTS.SELECT_FILE"></td>
				<td class="text-left">
					<div class="input-group">
						<input type="file" class="form-control ff" file-model="vm.settings.file" file-changed="vm.fileChanged()" />
						<span class="input-group-addon" id="basic-addon2">{{ vm.settings.file.size | prettysize }}</span>
					</div>
				</td>
			</tr>
			<tr>
				<td class="text-right tdBold" translate="TORRENTS.NFO"></td>
				<td class="text-left">
					<textarea class="form-control" ng-model="vm.settings.nfo" on-paste-text="vm.stripNfo()" rows="12"></textarea>
				</td>
			</tr>
			<tr>
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.CATEGORY"></td>
				<td class="text-left">
					<select class="form-control" ng-change="vm.categoryChanged()" ng-model="vm.settings.category" ng-options="i.id as i.text for i in ::vm.categories">
					</select>
				</td>
			</tr>
			<tr ng-show="vm.settings.category == 8">
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.TV_CHANNEL"></td>
				<td class="text-left">
					<select class="form-control" ng-model="vm.settings.channel" ng-options="i.id as i.namn for i in vm.tvChannels" ng-change="vm.updatePrograms()">
					</select>
				</td>
			</tr>
			<tr ng-show="vm.settings.category == 8 && vm.tvPrograms">
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.TV_PROGRAM"></td>
				<td class="text-left">
					<select class="form-control" ng-model="vm.settings.program" ng-options="i.id as i.program for i in vm.tvPrograms">
					</select>
					<div ng-show="vm.settings.program == 1">
						<strong>{{ 'TORRENTS.TV_PROGRAM_NAME' | translate }}:</strong>
						<input type="text" class="form-control" ng-model="vm.settings.programTitle" />
						<strong>{{ 'TORRENTS.TV_AIR_DATE' | translate }}:</strong>
						<select class="form-control" ng-model="vm.settings.programDate" ng-options="i as i for i in ::vm.tvDates">
						</select>
						<strong>{{ 'TORRENTS.TV_AIR_TIME' | translate }}:</strong>
						<input type="text" class="form-control" ng-model="vm.settings.programTime" style="width: 100px;" pattern="\d{2}:\d{2}" />
					</div>
				</td>
			</tr>
			<tr>
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.IMDB_URL"></td>
				<td class="text-left">
					<div class="input-group" style="width: 100%">
						<input type="text" class="form-control" style="width: 50%" ng-model="vm.settings.imdbUrl" placeholder="http://" ng-change="vm.fetchImdbInfo()"/>
						<span class="input-group" style="width: 50%;">
							<input type="text" class="form-control" ng-model="vm.settings.imdbInfo" readonly />
							<span class="input-group-btn" ng-show="vm.settings.imdbId">
								<button class="btn btn-default" type="button" ng-click="vm.removeImdb()"><i class="fa fa-times"></i></button>
							</span>
						</span>
					</div>
				</td>
			</tr>
			<tr>
				<td class="text-right tdBold alignMiddle" translate="GENERAL.ANONYMOUS"></td>
				<td class="text-left">
					<div class="btn-group">
						<label class="btn btn-default" ng-model="vm.settings.anonymousUpload" uib-btn-radio="1" translate="BUTTONS.YES"></label>
						<label class="btn btn-default" ng-model="vm.settings.anonymousUpload" uib-btn-radio="0" translate="BUTTONS.NO"></label>
					</div>
				</td>
			</tr>
			<tr ng-show="vm.currentUser.class >= 6">
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.SECTION"></td>
				<td class="text-left">
					<div class="btn-group">
						<label class="btn btn-default" ng-model="vm.settings.section" uib-btn-radio="'new'" translate="TORRENTS.NEW"></label>
						<label class="btn btn-default" ng-model="vm.settings.section" uib-btn-radio="'archive'" translate="TORRENTS.ARCHIVE_DESCRIPTION"></label>
					</div>
				</td>
			</tr>
			<tr>
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.P2P_RELEASES"></td>
				<td class="text-left">
					<div class="btn-group">
						<label class="btn btn-default" ng-model="vm.settings.p2p" uib-btn-radio="1" translate="BUTTONS.YES"></label>
						<label class="btn btn-default" ng-model="vm.settings.p2p" uib-btn-radio="0" translate="BUTTONS.NO"></label>
					</div>
				</td>
			</tr>
			<tr ng-show="[4,5,6,7,15].indexOf(vm.settings.category) != -1">
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.SWE_SUBTITLES"></td>
				<td class="text-left">
					<div class="btn-group">
						<label class="btn btn-default" ng-model="vm.settings.swesub" uib-btn-radio="1" translate="BUTTONS.YES"></label>
						<label class="btn btn-default" ng-model="vm.settings.swesub" uib-btn-radio="0" translate="BUTTONS.NO"></label>
					</div>
				</td>
			</tr>
			<tr ng-show="[8,9,10,11,12,14].indexOf(vm.settings.category) != -1">
				<td class="text-right tdBold alignMiddle" translate="TORRENTS.SWE_AUDIO"></td>
				<td class="text-left">
					<div class="btn-group">
						<label class="btn btn-default" ng-model="vm.settings.sweaudio" uib-btn-radio="1" translate="BUTTONS.YES"></label>
						<label class="btn btn-default" ng-model="vm.settings.sweaudio" uib-btn-radio="0" translate="BUTTONS.NO"></label>
					</div>
				</td>
			</tr>
		</table>
		<br />
		<uib-progressbar class="progress-striped" value="vm.settings.progress" type="success"></uib-progressbar>
		<br />

		<uib-alert type="{{ vm.alert.type }}" close="vm.closeAlert()" ng-show="vm.alert != null">
		 	{{ vm.alert.msg }}
		</uib-alert>

		<div ng-show="vm.settings.nfo.length > 2 && vm.settings.file && !vm.settings.imdbId && vm.isMoveOrTvSeries()" class="alert alert-warning" role="alert" translate="TORRENTS.IMDB_URL_MISSING"></div>

		<div class="text-center">
			<button type="submit" class="btn btn-primary" ng-disabled="vm.submitDisabled" translate="TORRENTS.UPLOAD"></button>
		</div>
	</form>
	</div>

	<br />
	<br />
	<br />

	<movie-info movie-data="vm.settings.movieData" ng-show="vm.settings.movieData.title != null"></movie-info>
</div>
